/*
 * String.c
 *
 *  Created on: 2011-5-24
 *      Author: william nie
 */

#include"SString.h"

Status SStrAssign(SString *sString , char *chars){
	int strLen = 0;
	int count = 0;

	while(chars[count]!='\0'){
		(*sString)[count+1]=chars[count];
		count++;
		strLen++;
	}

	(*sString)[strLen+1] = '\0';

	(*sString)[0] = strLen;

	return OK;

}

Status SStrCopy(SString *sStringA , SString sStringB){

}

BOOL SStrEmpty(SString sString);

Status SStrExpand(SString sString);

int SStrCompare(SString sStringA , SString sStringB);

int SStrLength(SString sString);

Status ClearSString(SString *sString);

Status ContactSStr(SString *sString , SString sStringA , SString sStringB){

}

Status SubSString(SString mainString , int pos , int len , SString *subString){

}

int SStrIndex(SString mainString , SString subToFind , int pos);

Status SStrReplace(SString *mainString , SString sStrToRep , SString sStr);

Status SStrInsert(SString *mainString , int pos , SString sString);

Status SStrDelete(SString *mainString , int pos , int len);

Status DestroySString(SString *sString);

Status PrintSString(SString sString){
	int i = 0;
	while(i<sString[0]){
		printf("%c",sString[i+1]);
		i++;
	}

	return OK;
}
